<% 
	var headContent = {
	include("/pages/template/head.html"){}
%>

<script type="text/javascript">
var oper;
jQuery(function($) {
	// 页面方法
	oper = {
		width : 750,
		height : 600,
		form : document.form1,
		list : function() {
			var url = 'quartz/times/list';
			this.form.action = url;
			this.form.submit();
		},
		add : function() {
			var url = 'quartz/times/add';
			var title = '新增时间规则';
			Iframe(url, this.width, this.height, title);
		},
		edit : function(id) {
			var url = 'quartz/times/edit/'+id;
			var title = '修改时间规则';
			Iframe(url, this.width, this.height, title);
		},
		del : function(pId) {
			var url = 'quartz/times/del/'+pId;
            Confirm('确定删除',function() {
                form1.action = url;
                form1.submit();
                return true;
            });
		}
	};
	//显示Menu索引
    showMenu('page_job');
	showMenu('page_job_times');
});

//分页
var paginator = function(page) {
	oper.list();
};
</script>

<%
};

var bodyContent = {
%>
	<form name="form1" action="" method="post"  class="form-inline" role="form">
		<!-- 菜单 -->
		<% include("/pages/template/menu.html"){} %>

		<div class="tableSearch">
			<%  //查询列表 %>
			<div class="form-group">
					<select name="attr.UIDS" onchange="conditionChange()" class="form-control">
					   <option value="" selected="selected">请输名称</option>
					   <% for(item in page.list) {%>
						<% if(item.uids == attr.UIDS) {%>
						<option value=${item.uids} selected = "selected">${item.timesName}</option>
						<% } else if(item.uids  != attr.UIDS) {%>
					     <option value=${item.uids}>${item.timesName}</option>
						<% } %>
					   <% } %>
					</select>
			</div>
			<button type="button" class="btn btn-default" onclick="oper.list();" name="search">
			 		<span class="glyphicon glyphicon-search"></span> 查 询
			</button>
			<button type="button" class="btn btn-default" onclick="oper.add();">
			 		<span class="glyphicon glyphicon-plus"></span> 新 增
			</button>
		</div>
		
		<!-- 数据列表 -->
		<table class="table table-striped table-bordered table-hover">
			<thead>
				<tr>
					<th>ID</th>
					<%  // 列表头部 %>
					<th name="timesName" class="sorting">规则名称</th>
					<th name="toQuartztimes" >Quartz表达式</th>
					<th name="state" class="sorting">状态</th>
					<th name="createDate" >创建时间</th>
					<th name="remark" >备注</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
			<% for(item in page.list) {%>
				<tr>
					<td>${item.uids }</td>
					<%  // 列表内容 %>
					<td>${item.timesName}</td>
					<td>${item.toQuartztimes}</td>
					<% if(item.state == '0') {%>
						<td>启用</td>
					<% } else if(item.state == '1') {%>
						<td>停用</td>
					<% } %>
					<td>${item.createDate}</td>
					<td>${item.remark}</td>
					<td>
						<a href="javascript:void(0);" class="btn btn-sm btn-primary" onclick="oper.edit('${item.uids}');">修改</a>
						<a href="javascript:void(0);" class="btn btn-sm btn-primary" onclick="oper.del('${item.uids}');">删除</a>
					</td>
				</tr>
			<% } %>
			</tbody>
		</table>
		<%include("/pages/includes/paginator.html"){} %>
	</form>
<%}; %>


<% layout("/pages/template/_layout.html",{head:headContent,body:bodyContent}){ %>
<%} %>
